import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/closure/gate_equipment_entity.dart';

GateEquipmentEntity $GateEquipmentEntityFromJson(Map<String, dynamic> json) {
  final GateEquipmentEntity gateEquipmentEntity = GateEquipmentEntity();
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    gateEquipmentEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    gateEquipmentEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    gateEquipmentEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    gateEquipmentEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    gateEquipmentEntity.deleted = deleted;
  }
  final String? deviceName = jsonConvert.convert<String>(json['deviceName']);
  if (deviceName != null) {
    gateEquipmentEntity.deviceName = deviceName;
  }
  final String? deviceNo = jsonConvert.convert<String>(json['deviceNo']);
  if (deviceNo != null) {
    gateEquipmentEntity.deviceNo = deviceNo;
  }
  final String? equipmentBrand = jsonConvert.convert<String>(json['equipmentBrand']);
  if (equipmentBrand != null) {
    gateEquipmentEntity.equipmentBrand = equipmentBrand;
  }
  final String? equipmentClassification = jsonConvert.convert<String>(json['equipmentClassification']);
  if (equipmentClassification != null) {
    gateEquipmentEntity.equipmentClassification = equipmentClassification;
  }
  final String? equipmentModel = jsonConvert.convert<String>(json['equipmentModel']);
  if (equipmentModel != null) {
    gateEquipmentEntity.equipmentModel = equipmentModel;
  }
  final String? equipmentPosition = jsonConvert.convert<String>(json['equipmentPosition']);
  if (equipmentPosition != null) {
    gateEquipmentEntity.equipmentPosition = equipmentPosition;
  }
  final String? equipmentSpecifications = jsonConvert.convert<String>(json['equipmentSpecifications']);
  if (equipmentSpecifications != null) {
    gateEquipmentEntity.equipmentSpecifications = equipmentSpecifications;
  }
  final int? equipmentStatus = jsonConvert.convert<int>(json['equipmentStatus']);
  if (equipmentStatus != null) {
    gateEquipmentEntity.equipmentStatus = equipmentStatus;
  }
  final String? equipmentType = jsonConvert.convert<String>(json['equipmentType']);
  if (equipmentType != null) {
    gateEquipmentEntity.equipmentType = equipmentType;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    gateEquipmentEntity.id = id;
  }
  final int? inOrOut = jsonConvert.convert<int>(json['inOrOut']);
  if (inOrOut != null) {
    gateEquipmentEntity.inOrOut = inOrOut;
  }
  final String? latitude = jsonConvert.convert<String>(json['latitude']);
  if (latitude != null) {
    gateEquipmentEntity.latitude = latitude;
  }
  final String? longitude = jsonConvert.convert<String>(json['longitude']);
  if (longitude != null) {
    gateEquipmentEntity.longitude = longitude;
  }
  final String? regionId = jsonConvert.convert<String>(json['regionId']);
  if (regionId != null) {
    gateEquipmentEntity.regionId = regionId;
  }
  final String? regionLevel = jsonConvert.convert<String>(json['regionLevel']);
  if (regionLevel != null) {
    gateEquipmentEntity.regionLevel = regionLevel;
  }
  final String? regionName = jsonConvert.convert<String>(json['regionName']);
  if (regionName != null) {
    gateEquipmentEntity.regionName = regionName;
  }
  final String? supplier = jsonConvert.convert<String>(json['supplier']);
  if (supplier != null) {
    gateEquipmentEntity.supplier = supplier;
  }
  final String? telephone = jsonConvert.convert<String>(json['telephone']);
  if (telephone != null) {
    gateEquipmentEntity.telephone = telephone;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    gateEquipmentEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    gateEquipmentEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    gateEquipmentEntity.updateDate = updateDate;
  }
  final int? whetherToInspect = jsonConvert.convert<int>(json['whetherToInspect']);
  if (whetherToInspect != null) {
    gateEquipmentEntity.whetherToInspect = whetherToInspect;
  }
  final int? allocatedQuantity = jsonConvert.convert<int>(json['allocatedQuantity']);
  if (allocatedQuantity != null) {
    gateEquipmentEntity.allocatedQuantity = allocatedQuantity;
  }
  final int? enteredQuantity = jsonConvert.convert<int>(json['enteredQuantity']);
  if (enteredQuantity != null) {
    gateEquipmentEntity.enteredQuantity = enteredQuantity;
  }
  return gateEquipmentEntity;
}

Map<String, dynamic> $GateEquipmentEntityToJson(GateEquipmentEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['deviceName'] = entity.deviceName;
  data['deviceNo'] = entity.deviceNo;
  data['equipmentBrand'] = entity.equipmentBrand;
  data['equipmentClassification'] = entity.equipmentClassification;
  data['equipmentModel'] = entity.equipmentModel;
  data['equipmentPosition'] = entity.equipmentPosition;
  data['equipmentSpecifications'] = entity.equipmentSpecifications;
  data['equipmentStatus'] = entity.equipmentStatus;
  data['equipmentType'] = entity.equipmentType;
  data['id'] = entity.id;
  data['inOrOut'] = entity.inOrOut;
  data['latitude'] = entity.latitude;
  data['longitude'] = entity.longitude;
  data['regionId'] = entity.regionId;
  data['regionLevel'] = entity.regionLevel;
  data['regionName'] = entity.regionName;
  data['supplier'] = entity.supplier;
  data['telephone'] = entity.telephone;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['whetherToInspect'] = entity.whetherToInspect;
  data['allocatedQuantity'] = entity.allocatedQuantity;
  data['enteredQuantity'] = entity.enteredQuantity;
  return data;
}

extension GateEquipmentEntityExtension on GateEquipmentEntity {
  GateEquipmentEntity copyWith({
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? deviceName,
    String? deviceNo,
    String? equipmentBrand,
    String? equipmentClassification,
    String? equipmentModel,
    String? equipmentPosition,
    String? equipmentSpecifications,
    int? equipmentStatus,
    String? equipmentType,
    String? id,
    int? inOrOut,
    String? latitude,
    String? longitude,
    String? regionId,
    String? regionLevel,
    String? regionName,
    String? supplier,
    String? telephone,
    String? updateBy,
    String? updateById,
    String? updateDate,
    int? whetherToInspect,
    int? allocatedQuantity,
    int? enteredQuantity,
  }) {
    return GateEquipmentEntity()
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..deviceName = deviceName ?? this.deviceName
      ..deviceNo = deviceNo ?? this.deviceNo
      ..equipmentBrand = equipmentBrand ?? this.equipmentBrand
      ..equipmentClassification = equipmentClassification ?? this.equipmentClassification
      ..equipmentModel = equipmentModel ?? this.equipmentModel
      ..equipmentPosition = equipmentPosition ?? this.equipmentPosition
      ..equipmentSpecifications = equipmentSpecifications ?? this.equipmentSpecifications
      ..equipmentStatus = equipmentStatus ?? this.equipmentStatus
      ..equipmentType = equipmentType ?? this.equipmentType
      ..id = id ?? this.id
      ..inOrOut = inOrOut ?? this.inOrOut
      ..latitude = latitude ?? this.latitude
      ..longitude = longitude ?? this.longitude
      ..regionId = regionId ?? this.regionId
      ..regionLevel = regionLevel ?? this.regionLevel
      ..regionName = regionName ?? this.regionName
      ..supplier = supplier ?? this.supplier
      ..telephone = telephone ?? this.telephone
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..whetherToInspect = whetherToInspect ?? this.whetherToInspect
      ..allocatedQuantity = allocatedQuantity ?? this.allocatedQuantity
      ..enteredQuantity = enteredQuantity ?? this.enteredQuantity;
  }
}
